abstract class Animal {
  eat() {
    console.log('eat');
    
  }
  abstract sleep(): void
}

class Dog extends Animal {
  constructor(name: string) {
    super()
    this.name = name
  }
  name: string
  readonly legs: number = 4
  static food: string = 'boss'
  run() {}
  private pri() {}
  protected pro() {}
  sleep() {
    console.log('dog sleep');
    
  }
}

console.log(Dog.prototype);
let dog  = new Dog('wang')
class Cat extends Animal{
  sleep(){
    console.log('cat sleep');
    
  }
}
let cat = new Cat()
let animals: Animal[] = [dog, cat]
animals.forEach(item => {
  // item.sleep()
})
// console.log(dog);
class Husky extends Dog {
  constructor(name: string, color: string) {
    super(name)
    this.color = color
    // this.pri()
    this.pro()
  }
  color: string
}

class WorkFlow {
  constructor(id: string){
    this.element = document.querySelector(id)
  }
  element: HTMLElement
  hide() {
    this.element.style.display = 'none'
    return this
  }
  show() {
    this.element.style.display = ''
    return this
  }
}
new WorkFlow('.box').hide().show()



